package com.snap.vseries.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import io.protostuff.Tag;

public class SettingInfo implements Serializable {

    //////////////////////////////////////////////////////////
    @Tag(8)
    private float[] coefficients;//荧光系数
    @Tag(10)
    private int lightBase = 2000;//荧光校准目标值
    @Tag(11)
    private String sn = "";//序列号
    @Tag(13)
    private float increaseVelocity = 2.5f;//升温速率
    @Tag(14)
    private float decreaseVelocity = 2.5f;//降温速率

    /////////////////version 2 添加的配置///////////////////////
    /**
     * 荧光串扰
     */
    @Tag(19)
    private double[] crossTalk;
    /**
     * 孔间偏移
     */
    @Tag(20)
    private float fitOffset;

    /***
     * 升温操作 目标温度高于此温度 开启拟合功能 //为了使老版本沿用过去的逻辑，默认值设定为升温不可能温度
     */
    @Tag(21)
    private int increaseThreshold = 120;
    /**
     * 开始拟合的温度起点距离目标温度的差值
     */
    @Tag(22)
    private int increasePreValue = 4;
    @Tag(23)
    private int increaseT1 = 8;
    @Tag(24)
    private int increaseT2 = 3;

    /**
     * 降温操作 目标温度低于此温度 开启拟合功能 //为了使老版本沿用过去的逻辑，默认值设定为降温不可能温度
     */
    @Tag(25)
    private int decreaseThreshold = 0;
    @Tag(26)
    private int decreasePreValue = 4;
    @Tag(27)
    private int decreaseT1 = 8;
    @Tag(28)
    private int decreaseT2 = 3;

    public SettingInfo() {
    }

    /**
     * 生成默认的设置文件
     */
    public static SettingInfo generateDefault() {
        SettingInfo info = new SettingInfo();

        //必填项


        float[] coefficients = new float[5];
        Arrays.fill(coefficients, 1f);

        info.setCoefficients(coefficients);

        double[] crossTalk = new double[16];
        for (int i = 0; i < crossTalk.length; i++) {
            if (i % 5 == 0) {
                crossTalk[i] = 1;
            }
        }
        info.setCrossTalk(crossTalk);

        //可选项
        info.setIncreaseThreshold(90);
        info.setDecreaseThreshold(60);
        return info;
    }

    public float[] getCoefficients() {
        return coefficients;
    }

    public void setCoefficients(float[] coefficients) {
        this.coefficients = coefficients;
    }

    public void setLightBase(int lightBase) {
        this.lightBase = lightBase;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public int getLightBase() {
        return lightBase;
    }

    public float getIncreaseVelocity() {
        return increaseVelocity;
    }

    public void setIncreaseVelocity(float increaseVelocity) {
        this.increaseVelocity = increaseVelocity;
    }

    public float getDecreaseVelocity() {
        return decreaseVelocity;
    }

    public void setDecreaseVelocity(float decreaseVelocity) {
        this.decreaseVelocity = decreaseVelocity;
    }

    public int getIncreaseThreshold() {
        return increaseThreshold;
    }

    public void setIncreaseThreshold(int increaseThreshold) {
        this.increaseThreshold = increaseThreshold;
    }

    public int getIncreasePreValue() {
        return increasePreValue;
    }

    public void setIncreasePreValue(int increasePreValue) {
        this.increasePreValue = increasePreValue;
    }

    public int getIncreaseT1() {
        return increaseT1;
    }

    public void setIncreaseT1(int increaseT1) {
        this.increaseT1 = increaseT1;
    }

    public int getIncreaseT2() {
        return increaseT2;
    }

    public void setIncreaseT2(int increaseT2) {
        this.increaseT2 = increaseT2;
    }

    public int getDecreaseThreshold() {
        return decreaseThreshold;
    }

    public void setDecreaseThreshold(int decreaseThreshold) {
        this.decreaseThreshold = decreaseThreshold;
    }

    public int getDecreasePreValue() {
        return decreasePreValue;
    }

    public void setDecreasePreValue(int decreasePreValue) {
        this.decreasePreValue = decreasePreValue;
    }

    public int getDecreaseT1() {
        return decreaseT1;
    }

    public void setDecreaseT1(int decreaseT1) {
        this.decreaseT1 = decreaseT1;
    }

    public int getDecreaseT2() {
        return decreaseT2;
    }

    public void setDecreaseT2(int decreaseT2) {
        this.decreaseT2 = decreaseT2;
    }

    public double[] getCrossTalk() {
        return crossTalk;
    }

    public void setCrossTalk(double[] crossTalk) {
        this.crossTalk = crossTalk;
    }

    public float getFitOffset() {
        return fitOffset;
    }

    public void setFitOffset(float fitOffset) {
        this.fitOffset = fitOffset;
    }
}